package com.ruicar.afs.cloud.batch.steps;

import com.ruicar.afs.cloud.batch.enums.BatchType;
import com.ruicar.afs.cloud.batch.frame.AbsBatchRunner;
import com.ruicar.afs.cloud.batch.service.AfsBatchInfoService;
import com.ruicar.afs.cloud.common.core.enums.AfsEnumUtil;
import com.ruicar.afs.cloud.common.core.util.SpringContextHolder;
import org.springframework.util.Assert;

public class FinishAllStep extends AbsBatchRunner {
    @Override
    public void process(String param) {
        BatchType batchType = (BatchType) AfsEnumUtil.getEnum(param,BatchType.class);
        Assert.isTrue(batchType!=null,"参数必须为 ALL，DB，DE里的一个");
        SpringContextHolder.getBean(AfsBatchInfoService.class).changeBatchToNormal(this.getSystemName(),batchType);
    }
}
